Перейти к основному содержимому

Edit Reseller API

POST /editReseller

Description

This API endpoint allows an admin to edit and update the details of an existing reseller by providing the reseller's ID and the updated information. The admin can update the reseller's email, phone number, and other details.

Request Body

The request utilizes GraphQL to perform the editReseller mutation.

Mutation:

mutation editReseller ($id: Int!, $reseller: ResellerEdit) {
editReseller (id: $id, reseller: $reseller) {
id
email
firstName
lastName
credit
level
phone
}
}

Variables:

{
"id": 0,
"reseller": {
"email": "<Reseller_Email>",
"phone": "<Phone_Number>"
}
}
  • id (Int): The unique identifier of the reseller whose details are being updated.
  • reseller (ResellerEdit Object): An object containing the updated reseller details.
    • email (String): The updated email address of the reseller.
    • phone (String): The updated phone number of the reseller.

Response:

  • Success (200 OK):

    • If the reseller update is successful, the response will return the updated reseller's details, including their ID, email, phone, and other attributes.
    {
    "data": {
    "editReseller": {
    "id": "<Reseller_ID>",
    "email": "<Reseller_Email>",
    "firstName": "<First_Name>",
    "lastName": "<Last_Name>",
    "credit": "<Credit_Amount>",
    "level": "<Reseller_Level>",
    "phone": "<Phone_Number>"
    }
    }
    }
  • Error (4XX/5XX):

    • Appropriate error messages and status codes will be returned in cases of invalid reseller ID, missing required fields, or server errors.

Note:

Ensure that the id corresponds to an existing reseller and that the reseller object contains valid and correctly formatted data. This API should be used by admins with the necessary permissions to manage and update reseller accounts.